function [Params, estimationErrors, varargout] = estimate_extrinsic_2dDTMatching_CERES( map_dt, ...
                                                                                        cur_laserScan_xy, ...
                                                                                        map_struct, ...
                                                                                        estimateExtrinsicParams)
  % estimate the extrinsic parameters based on map_dt matching using CERES

  warning('off','all');

  Params = struct();
  Params.opt = [];
  estimationErrors = [];

  initExtrinsicParamsEuler = estimateExtrinsicParams.initExtrinsicParams; % [x y yaw]
  verbose = estimateExtrinsicParams.verbose;
  cauchy_c = estimateExtrinsicParams.cauchy_c;
  map_res = map_struct.resolution;
  map_origin = map_struct.origin;

  extrinsicParamsEuler = estimateExtrinsic2dMapDtMatchingCeresMex(double(map_dt), ...
                                                              double(cur_laserScan_xy), ...
                                                              double(initExtrinsicParamsEuler), ...
                                                              double(map_res), ...
                                                              double(map_origin(1:2)), ...
                                                              double(cauchy_c), ...
                                                              double(verbose));

  Params.opt = extrinsicParamsEuler;

  init_dt_loss = calc_dt_loss(map_dt, cur_laserScan_xy, initExtrinsicParamsEuler, map_struct);
  estimated_dt_loss = calc_dt_loss(map_dt, cur_laserScan_xy, extrinsicParamsEuler, map_struct);

  estimationErrors = estimated_dt_loss;

  if verbose
    fprintf('initErrors eval: %.6f, [x y yaw]: [%.4f %.4f %.4f]\n', ...
            init_dt_loss, ...
            initExtrinsicParamsEuler(1), ...
            initExtrinsicParamsEuler(2), ...
            initExtrinsicParamsEuler(3));

    fprintf('estimationErrors eval: %.6f, [x y yaw]: [%.4f %.4f %.4f]\n', ...
            estimated_dt_loss, ...
            extrinsicParamsEuler(1), ...
            extrinsicParamsEuler(2), ...
            extrinsicParamsEuler(3));
  end
end
